package com.sikaryofficial.system.api.factory;

import com.sikaryofficial.common.core.domain.R;
import com.sikaryofficial.system.api.InnerNetSystemService;
import com.sikaryofficial.system.api.model.LoginUser;
import org.springframework.cloud.openfeign.FallbackFactory;

import java.util.List;

/**
 * @author : wuweihong
 * @desc : TODO  请填写你的功能描述
 * @date : 2024-11-29
 */


public class InnerNetSystemFallbackFactory  implements FallbackFactory<InnerNetSystemService> {
	@Override
	public InnerNetSystemService create(Throwable cause) {
		return new InnerNetSystemService() {
			@Override
			public R<LoginUser> info(String username) {
				return R.fail("获取用户信息失败:" + cause.getMessage());
			}

			@Override
			public R<List<LoginUser>> getInfos(String usernames) {
				return R.fail("获取用户信息失败:" + cause.getMessage());
			}
		};
	}
}
